package com.zzy.study.buffer;

import java.nio.ByteBuffer;

public class TestBuffer {

	public static void main(String[] args) {
		ByteBuffer buffer = ByteBuffer.allocate(1024);
		buffer.putLong(10L);
		buffer.putLong(10L);
		
		
		buffer.flip();
		
		System.out.println(buffer.getLong());
		buffer.compact();
		System.out.println(buffer.getLong());
		
		buffer.clear();
		buffer.putLong(100L);
		buffer.putLong(1005L);
	}
}
